home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / amiga / opalvisn / lsidocs.lha / Include / Opal / atool.h next >
Encoding:
C/C++ Source or Header  |  1993-02-08  |  4.6 KB  |  150 lines

  1. #ifndef ARTISTTOOLS_H
  2. #define ARTISTTOOLS_H
  3.  
  4. #ifndef EXEC_TYPES_H
  5. #include "exec/types.h"
  6. #endif
  7.  
  8. #ifndef OPALLIB_H
  9. #include "opal/opallib.h"
  10. #endif
  11.  
  12.  
  13. #ifndef    LIBRARIES_DOS_H
  14. #include "libraries/dos.h"
  15. #endif
  16.  
  17.  
  18. /* This is a Read Only structure containing some
  19.  * useful functions needed by brushes.
  20.  */
  21.  
  22. struct AToolInfo
  23.     { USHORT OPVersion;
  24.       USHORT OPRevision;
  25.       struct OpalScreen *DispScrn;
  26.       struct OpalScreen *FullImage;
  27.       struct SetUp *SetUp;
  28.       struct OpalBase *OpalBase;
  29.       SHORT PenRed,PenGreen,PenBlue;
  30.       struct DModeInfo *DModeInfo;
  31.  
  32.       void (*Render_Circular_Brush) (SHORT x, SHORT y);
  33.       void (*Render_Rectangular_Brush) (SHORT x, SHORT y);
  34.       void (*OneColour_WritePixel) (SHORT x,SHORT y);
  35.       void (*OneColour_ClearPixel) (SHORT x,SHORT y);
  36.       void (*OneColour_XORPixel) (SHORT x,SHORT y);
  37.       void (*OneColour_PutCircle) (SHORT x,SHORT y);
  38.       void (*OneColour_ClearCircle) (SHORT x,SHORT y);
  39.       void (*OneColour_XORCircle) (SHORT x,SHORT y);
  40.       void (*OneColour_PutRectangle) (SHORT x,SHORT y);
  41.       void (*OneColour_ClearRectangle) (SHORT x,SHORT y);
  42.       void (*OneColour_XORRectangle) (SHORT x,SHORT y);
  43.       void (*Display_ReadPixel) (SHORT x, SHORT y, UBYTE *R, UBYTE *G, UBYTE *B);
  44.       void (*Undo_ReadPixel) (SHORT x, SHORT y, UBYTE *R, UBYTE *G, UBYTE *B);
  45.       void (*Render_Func) (SHORT x, SHORT y, UBYTE R, UBYTE G, UBYTE B, UBYTE Trans);
  46.       void (*Set_RenderMode) (enum DrawModes DMode);
  47.       void (*Set_Draw_Tool) (enum ToolTypes Tool);
  48.       void (*Restore_RenderMode) (void);
  49.       void (*Set_Brush_Trans) (UBYTE Trans);
  50.       UBYTE (*Paper_Depth) (SHORT x, SHORT y);
  51.       void (*RGB_to_HSV) (SHORT R,SHORT G,SHORT B,USHORT *H, USHORT *S,USHORT *V);
  52.       void (*RGB_to_V) (SHORT R,SHORT G,SHORT B,USHORT *V);
  53.       void (*RGB_to_SV) (SHORT R,SHORT G,SHORT B,USHORT *S,USHORT *V);
  54.       void (*HSV_to_RGB) (ULONG H,ULONG S,ULONG V,UBYTE *R,UBYTE *G,UBYTE *B);
  55.       BOOL (*Build_Request) (SHORT Width,SHORT Height,SHORT Flags,struct IntuiText *Text,
  56.         struct Gadget *OtherGads,void (*GadgetFunc)(),
  57.         void (*InitFunc)(),void (*MMFunc)(),SHORT HelpX,SHORT HelpY,
  58.         STRPTR BaseName, STRPTR *Context);
  59.       void (*User_Message) (char *Mess);
  60.       BOOL (*Ask_User) (char *Mess);
  61.       BOOL (*File_Req) (char *Hail,char *Extension, char *Path, char *FileName);
  62.       void (*OPEndRequest)(void);
  63.       struct Screen *OpalScreen;
  64.       struct Window *OpalWindow;
  65.       void (*Refresh_Menu)(void);
  66.       BOOL (*Build_Req_Tags) (struct TagItem *tagList);
  67.     };
  68.  
  69. /* When loaded, the requested shape for the brush
  70.  * is passed in 'Type'. You may choose to ignore this
  71.  * value, however the actual type must be placed
  72.  * in type on setup.
  73.  */
  74.  
  75. struct AToolConfig
  76.     { ULONG Flags;
  77.       SHORT Width,Height;        /* Brush Size        */
  78.       SHORT MaxWidth,MaxHeight;
  79.       SHORT HandleX,HandleY;    /* Handle position    */
  80.       SHORT Type;            /* Put brush shape here */
  81.       USHORT Weight;
  82.       USHORT Speed;
  83.       SHORT Variant;
  84.       SHORT Pressure;        /* not used */
  85.       BPTR Segment;
  86.       char ToolName[30];
  87.       ULONG DModeFlags;    /* No flags used at present */
  88.  
  89.         /* These pointers MUST be intialised */
  90.       SHORT NumVariants;
  91.       char **VariantText;
  92.       void (*Reset_Brush) (void);
  93.       void (*New_Stroke) (void);
  94.       void (*CleanUp) (void);
  95.       void (*Render_Brush) (SHORT x, SHORT y);
  96.       void (*OneColour_PutBrush) (SHORT x, SHORT y);
  97.       void (*OneColour_XORBrush) (SHORT x, SHORT y);
  98.       void (*Stencil_PutBrush) (SHORT x, SHORT y);
  99.       void (*Stencil_ClearBrush) (SHORT x, SHORT y);
  100.       void (*Resize_PutBrush) (SHORT x, SHORT y);
  101.       void (*PlaceHandle_PutBrush) (SHORT x, SHORT y);
  102.       void (*DMode_OverRide) (SHORT x, SHORT y, SHORT R, SHORT G, SHORT B);
  103.       void (*DMode_NewBrush) (SHORT x, SHORT y);
  104.       void (*DMode_NewStroke) (void);
  105.       void (*ATool_Options) (void);
  106.       struct AToolInfo *AToolInfo;
  107.       USHORT ToolVersion;    /* version of opalpaint tool was written for */
  108.       USHORT ToolRevision;
  109.  
  110.       ULONG TabletFlags;
  111.       ULONG Pen_AngleX;    /* Pen tilt value */
  112.       ULONG Pen_AngleY;
  113.       ULONG Pen_AngleZ;
  114.       ULONG    Pen_Pressure;
  115.     };
  116.  
  117.  
  118.     /* Brush Types  */
  119. #define ATT_RECTANGULAR    1
  120. #define ATT_CIRCULAR    2
  121. #define ATT_VERTICAL    3
  122. #define ATT_HORIZONTAL    4
  123.  
  124.     /* Brush Flags */
  125. #define ATF_NEEDTRANS    0x1    /* Brush uses transparency modulation */
  126. #define ATF_NOHANDLE    0x2
  127. #define ATF_AUTOREPEAT    0x4
  128. #define ATF_MODWEIGHT    0x8
  129. #define ATF_MODSIZE    0x10
  130. #define ATF_NOSIZEMOD    0x20
  131. #define ATF_NOWEIGHTMOD    0x40
  132. #define ATF_ALLOWBYPASS 0x80
  133. #define ATF_BOOTUP    0x100
  134. #define ATF_MODDMODE    0x200
  135. #define ATF_BUILDUP    0x400        /* Override for the Brush Build up prefs */
  136. #define ATF_MODTRANS    0x800
  137. #define ATF_MODALPHA    0x1000
  138.  
  139.  
  140.     /* Tablet Flags */
  141.  
  142. #define TAB_PRESSVALID    0x1
  143. #define TAB_ANGLEXVALID    0x2
  144. #define TAB_ANGLEYVALID    0x4
  145. #define TAB_ANGLEZVALID    0x8
  146. #define TAB_INPROXIMITY    0x10
  147.  
  148. #endif
  149.  
  150.